package md.lanjing.com.module_home.api;



import com.lxh.baselibray.base.BaseResponce;

import md.lanjing.com.module_home.bean.CartonResponce;
import md.lanjing.com.module_home.bean.ForgetLoginPwdRequest;
import md.lanjing.com.module_home.bean.ForgetLoginPwdResponse;
import md.lanjing.com.module_home.bean.ForgetPwdResponse;
import md.lanjing.com.module_home.bean.HomeRankResponse;
import md.lanjing.com.module_home.bean.LoginRequest;
import md.lanjing.com.module_home.bean.LoginResponse;
import md.lanjing.com.module_home.bean.NearDayProfitResponce;
import md.lanjing.com.module_home.bean.NoticeResponse;
import md.lanjing.com.module_home.bean.RegisterRequest;
import md.lanjing.com.module_home.bean.RegisterResponse;
import md.lanjing.com.module_home.bean.RegisterSecurityCodeRequest;
import md.lanjing.com.module_home.bean.RegisterSecurityCodeResponse;
import md.lanjing.com.module_home.bean.TodayProfitResponce;
import md.lanjing.com.module_home.bean.UserInfoResponce;
import retrofit2.Call;
import retrofit2.http.Body;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.Headers;
import retrofit2.http.POST;

public interface HomeApiService {
    @Headers({
            "Content-Type: application/json",
            "Accept: application/json",
    })

    /**
     * 登录
     */
    @POST("user/login")
    Call<LoginResponse> login(@Body LoginRequest request);

    /**
     * 注册
     * @param request
     * @return
     */
    @POST("user/register")
    Call<RegisterResponse>register(@Body RegisterRequest request);

    /**
     * 注册获取验证码
     * @param request
     *
     * @return
     */
    @POST("user/sendCode")
    Call<RegisterSecurityCodeResponse>getRegisterSecurityCode(@Body RegisterSecurityCodeRequest request);


    /**
     * 忘记登录密码
     * @param request
     * @return
     */
    @POST("user/forgetLoginPassword")
    Call<ForgetLoginPwdResponse>forgetLoginPwd(@Body ForgetLoginPwdRequest request);

    /**
     * 忘记登录密码获取验证码
     * @return
     */
    @POST("user/sendCode")
    Call<ForgetPwdResponse>getForgetPwdSecurityCode(@Body RegisterSecurityCodeRequest request);



    /**
     * 获取首页公告
     * @return
     */
    @POST("notice/findLastNotice")
    Call<NoticeResponse> getNotice();

    /**
     * 获取首页排名
     * @param pageNo
     * @return
     */
    @FormUrlEncoded
    @POST("userAssets/getUserAssetsRanking")
    Call<HomeRankResponse> getHomeRank(@Field("pageNo") int pageNo);

    /**
     * 获取今日收益
     * @param userId
     * @return
     */
    @FormUrlEncoded
    @POST("userAssets/getFewDaysIncome")
    Call<TodayProfitResponce> getTodayProfit(@Field("userId") int userId);

    /**
     * 获取近7日收益
     * @param userId
     * @return
     */
    @FormUrlEncoded
    @POST("userAssets/getSevenDaysIncome")
    Call<NearDayProfitResponce> getNearProfit(@Field("userId") int userId);

    /**
     * 获取用户信息-等级
     * @param userId
     * @return
     */
    @FormUrlEncoded
    @POST("user/getUserInfo")
    Call<UserInfoResponce> getUserInfo(@Field("userId") int userId);

    /**
     * 获取碳能量
     * @param userId
     * @return
     */
    @FormUrlEncoded
    @POST("userAssets/absorbCawd")
    Call<CartonResponce> getCarcon(@Field("userId") int userId);

    /**
     * 点击收取能量
     * @param profitId
     * @return
     */
    @FormUrlEncoded
    @POST("userAssets/clickProfit")
    Call<BaseResponce> receiveCarton(@Field("profitId") String profitId);


}
